package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.arg.OriginalArg;
import com.azier.kapacitor.script.method.Align;
import com.azier.kapacitor.script.method.Quite;
import com.azier.kapacitor.script.node.nodebind.CommonNodeBind;

import java.util.ArrayList;

/**
 * 1 * @Author: luoj
 * 2 * @Date: 2019/11/8 11:34
 * 3
 */
public class StatsNode extends AbstractNode implements CommonNodeBind {
    private static final String name = "stats";
    //durationLiteral 数据来源为 DurationLiteral类的常量
    public StatsNode(long interval, String durationLiteral){
        super(new ArrayList<>(),new ArrayList<>(),name);
        this.args.add(new OriginalArg(interval + durationLiteral));
    }

    public StatsNode align(){
        this.addMethod(new Align());
        return this;
    }
    public StatsNode quite(){
        this.addMethod(new Quite());
        return this;
    }
}
